package cn.edu.ctbu.test.dao;

import cn.edu.ctbu.test.domain.Score;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


public interface ScoreRepository extends JpaRepository<Score,Long> {


    @Query("select s from  score  as s where  s.studentId = ?1")
    List<Score> findByStudentId(Long studentId);


    List<Score> findAll(Specification<Score> scoreSpecification);
    Page<Score> findAll(Specification<Score> scoreSpecification, Pageable pageable);

    Integer count(Specification<Score> scoreSpecification);
}
